.. include:: /Includes.rst.txt .. _reserve-service: =============== Reserve service =============== The class `JWeiland\Reserve\Service\ReserveService` is the official public API for ext:reserve. You can use this class in your own extension to get some information like remaining participants of a period. The following example shows a controller that uses FlexForms or TypoScript for Facility and DateTime selection. This selection will be used to get the remaining participants of a matching period. .. code-block:: php reserveService = $reserveService; } public function showAction(): void { $dateTime = new \DateTime(); $dateTime->setTimestamp((int)$this->settings['dateTimeOfEvent']); $this->view->assign( 'remainingParticipants', $this->reserveService->getRemainingParticipants((int)$this->settings['facility'], $dateTime) ); } } The FlexForms.xml may look like this. .. code-block:: xml Main array input 10 inputDateTime datetime 0 group db tx_reserve_domain_model_facility 1 1 1 0